From ecf36632deb220d68b7da3c527b797f34847b728 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Florian=20M=C3=BCllner?= Date: Thu, 5 Jun 2025 15:33:16 +0200 Subject: [PATCH] timeLimitsManager: Pass extra transition options as params Boolean parameters are often harder to grasp, in particular when there are multiple. So before adding more optional flags to `_addTransition()`, pass flags as a params object. Part-of: --- js/misc/timeLimitsManager.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/js/misc/timeLimitsManager.js b/js/misc/timeLimitsManager.js index dc4590584..dd189e285 100644 --- a/js/misc/timeLimitsManager.js +++ b/js/misc/timeLimitsManager.js @@ -455,7 +455,8 @@ export const TimeLimitsManager = GObject.registerClass({ } } - _addTransition(oldState, newState, wallTimeSecs, recalculateState = true) { + _addTransition(oldState, newState, wallTimeSecs, + {recalculateState = true} = {}) { this._stateTransitions.push({ oldState, newState, @@ -542,8 +543,9 @@ export const TimeLimitsManager = GObject.registerClass({ this._addTransition( entry['oldState'], entry['newState'], - entry['wallTimeSecs'], - i === history.length - 1); + entry['wallTimeSecs'], { + recalculateState: i === history.length - 1, + }); previousWallTimeSecs = entry['wallTimeSecs']; } -- 2.39.5